// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Requests;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport;
using Elastic.Transport.Extensions;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Serverless;

public sealed partial class HealthReportRequestParameters : RequestParameters
{
	/// <summary>
	/// <para>
	/// Limit the number of affected resources the health report API returns.
	/// </para>
	/// </summary>
	public int? Size { get => Q<int?>("size"); set => Q("size", value); }

	/// <summary>
	/// <para>
	/// Explicit operation timeout.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q<Elastic.Clients.Elasticsearch.Serverless.Duration?>("timeout"); set => Q("timeout", value); }

	/// <summary>
	/// <para>
	/// Opt-in for more information about the health of the system.
	/// </para>
	/// </summary>
	public bool? Verbose { get => Q<bool?>("verbose"); set => Q("verbose", value); }
}

/// <summary>
/// <para>
/// Returns the health of the cluster.
/// </para>
/// </summary>
public sealed partial class HealthReportRequest : PlainRequest<HealthReportRequestParameters>
{
	public HealthReportRequest()
	{
	}

	public HealthReportRequest(IReadOnlyCollection<string>? feature) : base(r => r.Optional("feature", feature))
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceHealthReport;

	protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

	internal override bool SupportsBody => false;

	internal override string OperationName => "health_report";

	/// <summary>
	/// <para>
	/// Limit the number of affected resources the health report API returns.
	/// </para>
	/// </summary>
	[JsonIgnore]
	public int? Size { get => Q<int?>("size"); set => Q("size", value); }

	/// <summary>
	/// <para>
	/// Explicit operation timeout.
	/// </para>
	/// </summary>
	[JsonIgnore]
	public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q<Elastic.Clients.Elasticsearch.Serverless.Duration?>("timeout"); set => Q("timeout", value); }

	/// <summary>
	/// <para>
	/// Opt-in for more information about the health of the system.
	/// </para>
	/// </summary>
	[JsonIgnore]
	public bool? Verbose { get => Q<bool?>("verbose"); set => Q("verbose", value); }
}

/// <summary>
/// <para>
/// Returns the health of the cluster.
/// </para>
/// </summary>
public sealed partial class HealthReportRequestDescriptor : RequestDescriptor<HealthReportRequestDescriptor, HealthReportRequestParameters>
{
	internal HealthReportRequestDescriptor(Action<HealthReportRequestDescriptor> configure) => configure.Invoke(this);

	public HealthReportRequestDescriptor(IReadOnlyCollection<string>? feature) : base(r => r.Optional("feature", feature))
	{
	}

	public HealthReportRequestDescriptor()
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceHealthReport;

	protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

	internal override bool SupportsBody => false;

	internal override string OperationName => "health_report";

	public HealthReportRequestDescriptor Size(int? size) => Qs("size", size);
	public HealthReportRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout);
	public HealthReportRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose);

	public HealthReportRequestDescriptor Feature(IReadOnlyCollection<string>? feature)
	{
		RouteValues.Optional("feature", feature);
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
	}
}